import requests
from bs4 import BeautifulSoup
import time


def generate_url(i):
    base_url = r'http://audit.sz.gov.cn/zxbs/bggk/index'
    if i == 1:
        return f'{base_url}.html'
    else:
        return f'{base_url}_{i}.html'


for i in range(1, 11):
    req = requests.get(generate_url(i))
    soup = BeautifulSoup(req.text, features='lxml')
    for li in soup.select('div.right_list ul>li'):
        print(li.a.text, li.span.text, li.a['href'])
    time.sleep(2)
